<template>
  <div>
    <div v-if="comfirm">
      <el-tabs v-model="activeName">
        <el-tab-pane label="我的购物车" name="RentManage">
          <RentManage></RentManage>
        </el-tab-pane>
        <el-tab-pane label="待收货订单" name="second">
          <RentPay></RentPay>
        </el-tab-pane>
        <el-tab-pane label="历史订单" name="third">
          <RentHistory></RentHistory>
        </el-tab-pane>
        <el-tab-pane label="其它" name="others">
          <others></others>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="noComfirm" style="margin-left: 20px ;margin-top: 20px">
      <el-empty description="您还未完善个人信息哦！">
      </el-empty>
    </div>
  </div>

</template>

<script>
  import RentManage from '../../components/rent/RentManage'
  import RentPay from '../../components/rent/RentPay'
  import RentHistory from '../../components/rent/RentHistory'
  import others from '../../components/rent/others'
  export default {
    name: 'RentData',
    data(){
      return{
        activeName:'RentManage',
        user:JSON.parse(window.sessionStorage.getItem('user')),
        noComfirm:false,
        comfirm:false
      }
    },
    mounted(){
      this.initComfirm();
    },
    methods:{
      initComfirm(){
        this.postRequest('/personal/data/comfirmByuserId/'+this.user.userId).then(resp => {
          if (resp.code===200) {
            if (resp.message==='ok'){
              this.comfirm=true
            } else{
              this.noComfirm=true;
            }
          }else if(resp.code===500){
            this.noComfirm=true;
          }
        })
      }
    },
    components:{
      RentManage,
      RentPay,
      RentHistory,
      others
    }
  }
</script>

<style scoped>

</style>
